/*
 * File:   parser.h
 * Author: dolphinigle
 *
 * Created on December 1, 2011, 3:50 PM
 */

#ifndef PARSER_H
#define	PARSER_H

#include <string>
#include <vector>

#include "engine.h"
#include "scoped_ptr.h"

using std::string;
using std::vector;

class Parser {
public:
  // Takes ownership of input Engine. That is, this class will be responsible
  // for deleting engine when it goes out of scope.
  Parser(Engine* engine) : engine_(engine) {}

  // Executes a query and returns the result.
  // For example, executing "pwd" will return the current directory.
  // For example, executing "ls /home" will list all files in /home
  string Execute(string query);

private:

  scoped_ptr<Engine> engine_;

  vector<string> StringSplit(string input_str, char separator);

  Parser(const Parser& orig) {
  }

  bool operator=(const Parser& orig) {
  }
};

#endif	/* PARSER_H */

